package com.cheng.service;

import com.cheng.dao.ProductTeamMapper;
import com.cheng.pojo.Product;
import com.cheng.pojo.Product_team;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.util.Date;
import java.util.List;

public class ProductTeamServiceImpl implements ProductTeamService {

    //service调dao层:组合Dao
    private ProductTeamMapper productTeamMapper;
    public void setProductTeamMapper(ProductTeamMapper productTeamMapper) {
        this.productTeamMapper=productTeamMapper;
    }


    @Override
    public int addmerchandise(String productcode, String productname, String productdetil, Date qwer, String productpath, String productgo, String touring_party_code, String productdetils, String priductaddress, String userCode, String img01, String img02, String img03, String img04, String img05, String price, String team_number, String remain_number, String group_number) {
        return productTeamMapper.addmerchandise(productcode,productname,productdetil,qwer,productpath,productgo,touring_party_code,productdetils,priductaddress,userCode,img01,img02,img03,img04,img05,price,team_number,remain_number,group_number);
    }

    @Override
    public PageInfo<Product_team> querymerchantsTeamProduct(int page, int pageSize, String userCode) {
        PageHelper.startPage(page, pageSize);
        List<Product_team> list = productTeamMapper.querymerchantsTeamProduct(userCode);
        PageInfo<Product_team> pageInfo = new PageInfo<Product_team>(list);

        return pageInfo;
    }

    @Override
    public int merchantsDeleteTeamProduct(String productcode) {
        return productTeamMapper.merchantsDeleteTeamProduct(productcode);
    }

    @Override
    public int updateremain_number(String productcode,String Adult_number,String Child_number) {
        return productTeamMapper.updateremain_number(productcode,Adult_number,Child_number);
    }

    @Override
    public PageInfo<Product_team> queryAllProduct(int page, int pageSize) {
        PageHelper.startPage(page, pageSize);
        List<Product_team> list = productTeamMapper.queryAllProduct();
        PageInfo<Product_team> pageInfo = new PageInfo<Product_team>(list);

        return pageInfo;
    }

    @Override
    public PageInfo<Product_team> queryNumberProduct(int page, int pageSize, String number01) {
        PageHelper.startPage(page, pageSize);
        List<Product_team> list = productTeamMapper.queryNumberProduct(number01);
        PageInfo<Product_team> pageInfo = new PageInfo<Product_team>(list);

        return pageInfo;
    }

    @Override
    public Product_team quryOenProduct(String productcode) {
        return productTeamMapper.quryOenProduct(productcode);
    }

    @Override
    public List<Product_team> allteamproduct() {
        return productTeamMapper.allteamproduct();
    }

    @Override
    public List<Product_team> team_number(String group_number) {
        return productTeamMapper.team_number(group_number);
    }

    @Override
    public int remove_number(String productcode, String adult_number, String child_number) {
        return productTeamMapper.remove_number(productcode,adult_number,child_number);
    }

    @Override
    public Product_team detail(String productcode) {
        return productTeamMapper.detail(productcode);
    }

}
